<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="docgen-resources/docgen.css" type="text/css">
  <meta name="generator" content="FreeMarker Docgen (DocBook 5)">
  <title>
    FreeMarker Manual - White-space handling
  </title>
    <script type="text/javascript" src="docgen-resources/jquery.js"></script>
    <script type="text/javascript" src="docgen-resources/linktargetmarker.js"></script>
</head>
<body>

    <div class="navigation">
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="dgui.html">Template Author's Guide</a>
            <b>></b>
          <a href="dgui_misc.html">Miscellaneous</a>
            <b>></b>
          White-space handling
</span>    </div>
    <div class="bookmarks">
<span class="bookmarks">Bookmarks:
<a href="alphaidx.html">Alphabetical Index</a>, <a href="gloss.html">Glossary</a>, <a href="ref.html">Reference</a>, <a href="app_faq.html">FAQ</a>, <a href="api/index.html">Java API</a>, <a href="../index.html">FreeMarker Home</a></span>    </div>
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="dgui_misc_alternativesyntax.html"><span class="hideA">Next page: </span>Alternative (square bracket) syntax</a></div><div class="pagerButton"><a href="dgui_misc_namespace.html">Previous page</a></div><div class="pagerButton"><a href="dgui_misc.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    </div>

<div id="mainContent">

  
  
  
  
  <h1 class="rank_section1"
        id="pageTopTitle">
<a name="dgui_misc_whitespace"></a>White-space handling  </h1>
    
    <div class="toc">
      <p>
        <b>
            Page Contents
        </b>
      </p>
      
  <ul class="noMargin">
      <li style="padding-bottom: 0.5em"><i><a href="#docgen_afterTheTOC">Intro.</a></i></li>
      <li>
        <a href="#dgui_misc_whitespace_stripping">White-space stripping</a>
      </li>
      <li>
        <a href="#autoid_30">Using compress directive</a>
      </li>
  </ul>
    </div>
    <a name="docgen_afterTheTOC"></a>
    
<p>The control of the <a href="gloss.html#gloss.whiteSpace">white-space</a> in a template is a
        problem that to some extent haunts every template engine in the
        business.</p><p>Let see this template. I have marked the components of template
        with colors: <span style="background-color:#8acbfa">text</span>, <span style="background-color:#ffb85d">interpolation</span>, <span style="background-color:#dbfe5e">FTL tag</span>. With the <i><span style="color: #999999 ">[BR]</span></i>-s I visualize the <a href="gloss.html#gloss.lineBreak">line breaks</a>.</p><div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
<span style="background-color:#8acbfa">&lt;p&gt;List of users:<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<span style="background-color:#dbfe5e">&lt;#assign users = [{&quot;name&quot;:&quot;Joe&quot;,        &quot;hidden&quot;:false},<i><span style="color: #999999 ;background-color:#dbfe5e">[BR]</span></i>
                  {&quot;name&quot;:&quot;James Bond&quot;, &quot;hidden&quot;:true},<i><span style="color: #999999 ;background-color:#dbfe5e">[BR]</span></i>
                  {&quot;name&quot;:&quot;Julia&quot;,      &quot;hidden&quot;:false}]&gt;</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<span style="background-color:#dbfe5e">&lt;#list users as user&gt;</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <span style="background-color:#dbfe5e">&lt;#if !user.hidden&gt;</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  &lt;li&gt;<span style="background-color:#ffb85d">${user.name}</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <span style="background-color:#dbfe5e">&lt;/#if&gt;</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<span style="background-color:#dbfe5e">&lt;/#list&gt;</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;/ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;p&gt;That's all.</span>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>
<p>If FreeMarker were to output all <span style="background-color:#8acbfa">text</span> as is, the output would be:</p><div align="left" class="programlisting"><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
<span style="background-color:#8acbfa">&lt;p&gt;List of users:<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  &lt;li&gt;</span>Joe<span style="background-color:#8acbfa"><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>  
  &lt;li&gt;</span>Julia<span style="background-color:#8acbfa"><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  <i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;/ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;p&gt;That's all.</span>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>
<p>You have a lot of unwanted spaces and line breaks here.
        Fortunately neither HTML nor XML is typically white-space sensitive,
        but this amount of superfluous white-space can be annoying, and
        needlessly increases the size of produced HTML. Of course, it is even
        bigger problem when outputting white-space-sensitive formats.</p><p>FreeMarker provides the following tools to cope with this
        problem:</p>    <div class="itemizedlist">
<ul>
          <li>
            <p>Tools to ignore certain white-space of the template files
            <span style="color:#333399; font-style:italic">(parse time white-space
            removal)</span>:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <p>White-space stripping: This feature automatically
                ignores typical superfluous white-space around FTL tags. It
                can be enabled or disabled on per template manner.</p>
              </li>

              <li>
                <p>Trimmer directives: <tt style="color: #A03D10">t</tt>,
                <tt style="color: #A03D10">rt</tt>, <tt style="color: #A03D10">lt</tt>. With these
                directives you can explicitly tell FreeMarker to ignore
                certain white-space. Read <a href="ref_directive_t.html#ref.directive.t">the
                reference</a> for more information.</p>
              </li>

              <li>
                <p><a href="ref_directive_ftl.html#ref.directive.ftl"><tt>ftl</tt></a>
                parameter <tt style="color: #A03D10">strip_text</tt>. This removes all
                top-level text from the template. It is useful for templates
                that contain macro definitions only (and some other
                non-outputting directives), because it removes the line-breaks
                that you use between the macro definitions and between the
                other top-level directives to improve the readability of the
                template.</p>
              </li>
            </ul>    </div>

          </li>

          <li>
            <p>Tools that remove white-space from the output <span style="color:#333399; font-style:italic">(on-the-fly white-space
            removal)</span>:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <p><tt style="color: #A03D10">compress</tt> directive.</p>
              </li>
            </ul>    </div>

          </li>
        </ul>    </div>

            
  
  
  
  <h2 class="rank_section2"
        >
<a name="dgui_misc_whitespace_stripping"></a>White-space stripping  </h2>


          

          <p>If this feature is enabled for a template, then it
          automatically ignores (i.e. does not print to the output) two kind
          of typical superfluous white-space:</p>

              <div class="itemizedlist">
<ul>
            <li>
              <p>Indentation white-space, and trailing white-space at the
              end of the line (includes the line break) will be ignored in
              lines that contains only FTL tags (e.g.
              <tt style="color: #A03D10">&lt;@myMacro/&gt;</tt>, <tt style="color: #A03D10">&lt;#if
              <i style="color: #DD4400">...</i>&gt;</tt>) and/or FTL
              comments (e.g. <tt style="color: #A03D10">&lt;#-- blah --&gt;</tt>), apart
              from the the ignored white-space itself. For example, if a line
              contains only an <tt style="color: #A03D10">&lt;#if
              <i style="color: #DD4400">...</i>&gt;</tt>, then the
              indentation before the tag and the line break after the tag will
              be ignored. However, if the line contains <tt style="color: #A03D10">&lt;#if
              <i style="color: #DD4400">...</i>&gt;x</tt>, then the
              white-space in that line will not be ignored, because of the
              <tt style="color: #A03D10">x</tt>, as that is not FTL tag. Note that
              according these rules, a line that contains <tt style="color: #A03D10">&lt;#if
              <i style="color: #DD4400">...</i>&gt;&lt;#list
              <i style="color: #DD4400">...</i>&gt;</tt> is subject to
              white-space ignoring, while a line that contains
              <tt style="color: #A03D10">&lt;#if <i style="color: #DD4400">...</i>&gt; &lt;#list
              <i style="color: #DD4400">...</i>&gt;</tt> is not, because the
              white-space between the two FTL tags is embedded white-space,
              not indentation or trailing white-space.</p>
            </li>

            <li>
              <p>White-space sandwiched between the following directives is
              ignored: <tt style="color: #A03D10">macro</tt>, <tt style="color: #A03D10">function</tt>,
              <tt style="color: #A03D10">assign</tt>, <tt style="color: #A03D10">global</tt>,
              <tt style="color: #A03D10">local</tt>, <tt style="color: #A03D10">ftl</tt>,
              <tt style="color: #A03D10">import</tt>, but only if there is
              <i>only</i> white-space and/or FTL comments
              between the directives. In practice it means that you can put
              empty lines between macro definitions and assignments as spacing
              for better readability, without printing needless empty lines
              (line breaks) to the output.</p>
            </li>
          </ul>    </div>


          <p>The output of the last example with white-space stripping
          enabled will be:</p>

          <div align="left" class="programlisting"><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
<span style="background-color:#8acbfa">&lt;p&gt;List of users:<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  &lt;li&gt;</span>Joe<span style="background-color:#8acbfa"><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
  &lt;li&gt;</span>Julia<span style="background-color:#8acbfa"><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;/ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;p&gt;That's all.</span>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>This is because after stripping the template becomes the
          following; the ignored text is not <span style="background-color:#8acbfa">colored</span>:</p>

          <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
<span style="background-color:#8acbfa">&lt;p&gt;List of users:<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i></span>
<span style="background-color:#dbfe5e">&lt;#assign users = [{&quot;name&quot;:&quot;Joe&quot;,        &quot;hidden&quot;:false},<i><span style="color: #999999 ;background-color:#dbfe5e">[BR]</span></i>
                  {&quot;name&quot;:&quot;James Bond&quot;, &quot;hidden&quot;:true},<i><span style="color: #999999 ;background-color:#dbfe5e">[BR]</span></i>
                  {&quot;name&quot;:&quot;Julia&quot;,      &quot;hidden&quot;:false}]&gt;</span><i><span style="color: #999999 ">[BR]</span></i>
<span style="background-color:#8acbfa">&lt;ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i></span>
<span style="background-color:#dbfe5e">&lt;#list users as user&gt;</span><i><span style="color: #999999 ">[BR]</span></i>
  <span style="background-color:#dbfe5e">&lt;#if !user.hidden&gt;</span><i><span style="color: #999999 ">[BR]</span></i>
<span style="background-color:#8acbfa">  &lt;li&gt;<span style="background-color:#ffb85d">${user.name}</span><i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i></span>
  <span style="background-color:#dbfe5e">&lt;/#if&gt;</span><i><span style="color: #999999 ">[BR]</span></i>
<span style="background-color:#dbfe5e">&lt;/#list&gt;</span><i><span style="color: #999999 ">[BR]</span></i>
<span style="background-color:#8acbfa">&lt;/ul&gt;<i><span style="color: #999999 ;background-color:#8acbfa">[BR]</span></i>
&lt;p&gt;That's all.</span>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>White-space stripping can be enabled/disabled in per template
          manner with the <a href="ref_directive_ftl.html#ref.directive.ftl"><tt>ftl</tt> directive</a>.
          If you don't specify this with the <tt style="color: #A03D10">ftl</tt> directive,
          then white-space stripping will be enabled or disabled depending on
          how the programmer has configured FreeMarker. The factory default is
          white-space stripping enabled, and the programmers probably left it
          so (<span style="color:#333399; font-style:italic">recommended</span>). <span style="color:#333399; font-style:italic">Note that enabling white-space stripping does
          <i>not</i> degrade the performance of template
          execution; white-space stripping is done during template
          loading.</span></p>

          <p>White-space stripping can be disabled for a single line with
          the <a href="ref_directive_nt.html#ref.directive.nt"><tt>nt</tt></a>
          directive (for No Trim).</p>
        
            
  
  
  
  <h2 class="rank_section2"
        >
<a name="autoid_30"></a>Using compress directive  </h2>


          

          <p>Another solution is to use the <a href="ref_directive_compress.html#ref.directive.compress"><tt>compress</tt>
          directive</a>. As opposed to white-space stripping, this works
          directly on the generated output, not on the template. That is, it
          will investigate the printed output on the fly, and does not
          investigate the FTL program that creates the output. It aggressively
          removes indentations, empty lines and repeated spaces/tabs (for more
          information read the <a href="ref_directive_compress.html#ref.directive.compress">reference</a>). So the output
          of:</p>

          <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
<b>&lt;#compress&gt;</b>
&lt;#assign users = [{&quot;name&quot;:&quot;Joe&quot;,        &quot;hidden&quot;:false},
                  {&quot;name&quot;:&quot;James Bond&quot;, &quot;hidden&quot;:true},
                  {&quot;name&quot;:&quot;Julia&quot;,      &quot;hidden&quot;:false}]&gt;
List of users:
&lt;#list users as user&gt;
  &lt;#if !user.hidden&gt;
  - ${user.name}
  &lt;/#if&gt;
&lt;/#list&gt;
That's all.
<b>&lt;/#compress&gt;</b>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>will be:</p>

          <div align="left" class="programlisting"><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
List of users:
- Joe
- Julia
That's all.&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>Note that <tt style="color: #A03D10">compress</tt> is totally independent
          of white-space stripping. So it is possible that the white-space of
          template is stripped, and later the produced output is
          <tt style="color: #A03D10">compress</tt>-ed.</p>

          <p>Also, by default a user-defined directve called
          <tt style="color: #A03D10">compress</tt> is available in the data-model (due to
          backward compatibility). This is the same as the directive, except
          that you may optionally set the <tt style="color: #A03D10">single_line</tt>
          parameter, which will remove all intervening line breaks. If you
          replace
          <tt style="color: #A03D10">&lt;#compress&gt;<i style="color: #DD4400">...</i>&lt;/#compress&gt;</tt>
          on the last example with <tt style="color: #A03D10">&lt;@compress
          single_line=true&gt;<i style="color: #DD4400">...</i>&lt;/@compress&gt;</tt>,
          then you get this output:</p>

          <div align="left" class="programlisting"><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
List of users: - Joe - Julia That's all.&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>

          
</div>

    <div class="navigation">
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="dgui_misc_alternativesyntax.html"><span class="hideA">Next page: </span>Alternative (square bracket) syntax</a></div><div class="pagerButton"><a href="dgui_misc_namespace.html">Previous page</a></div><div class="pagerButton"><a href="dgui_misc.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="dgui.html">Template Author's Guide</a>
            <b>></b>
          <a href="dgui_misc.html">Miscellaneous</a>
            <b>></b>
          White-space handling
</span>    </div>
    </div>

<table border=0 cellspacing=0 cellpadding=0 width="100%">
    <tr>
      <td colspan=2><img src="docgen-resources/img/none.gif" width=1 height=8 alt=""></td>
    <tr>
      <td align="left" valign="top"><span class="smallFooter">
            FreeMarker Manual -- For FreeMarker 2.3.16
            <br>
          HTML generated: 2009-12-08 08:38:54 GMT
      </span></td>
      <td align="right" valign="top"><span class="smallFooter">
          <a href="http://www.xmlmind.com/xmleditor/">
            <img src="docgen-resources/img/xxe.gif" alt="Edited with XMLMind XML Editor">
          </a>
      </span></td>
    </tr>
</table>
  <!-- Put pre-loaded images here: -->
  <div style="display: none">
    <img src="docgen-resources/img/linktargetmarker.gif" alt="Here!" />
  </div>
</body>
</html>

